package cc.zy.base.hr.controller;

import cc.zy.base.common.controller.BaseController;
import cc.zy.base.common.entity.FebsResponse;
import cc.zy.base.common.entity.QueryRequest;
import cc.zy.base.hr.entity.HRDictionary;
import cc.zy.base.hr.service.IHRDictionaryService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author zhang
 * @time 2022/03/09 20:33:27
 */
@Slf4j
@Validated
@Controller
@RequiredArgsConstructor
@RequestMapping("HRDictionary")
public class HRDictionaryController extends BaseController {
    @Resource
    private final IHRDictionaryService dictionaryService;

    @GetMapping("list")
    @ResponseBody
    public FebsResponse staffTagList(String hrdictionaryType) {
        log.debug("前台传来的字段类型是：" + hrdictionaryType);
        List<HRDictionary> hrDictionaryList = dictionaryService.findHRDictionaryList(hrdictionaryType);
        log.debug("拿到的字典数据有"+hrDictionaryList);
        return new FebsResponse().success().data(hrDictionaryList);
    }
}
